package com.tdking.common.pojo.po;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@Document(indexName = "content_reward_order")
public class OrderSearchPO implements Serializable {
    /**
     * 主键
     */
    @Id
    private Long id;

    /**
     * 购买用户Id
     */
    private Long buyerId;

    /**
     * 笔记Id
     */
    private Long noteId;

    /**
     * 笔记标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String noteTitle;

    /**
     * 订单编号
     */

    private String orderNo;

    /**
     * 总价
     */
    private String totalPrice;

    /**
     * 订单状态
     */
    private Integer orderState;

    /*支付时间*/
    @Field(type = FieldType.Date)
    private Date gmtPay;

    /*数据创建时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm.ss")
    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

}
